<?php
class SoapClientDebug extends SoapClient
{
  public function __doRequest($request, $location, $action, $version) {
      // Add code to inspect/dissect/debug/adjust the XML given in $request here

      // Uncomment the following line, if you actually want to do the request
      // return parent::__doRequest($request, $location, $action, $version);
  }
}

?>

<?php


class Easyjet{
	private $credUser = "B2BEentertainment";
	private $credPass ="Eentertainment@B2B";
	private $apiUser = "easyjetb2b@goedkope-vliegtickets.nl";
	private $apiPass = "Eentertainment@B2B";
	private $search;
	private $wsdlFunction = "RequestXml";
	
	
	public function Easyjet($searchQ){
		$this->search = $searchQ;
	}
	
	public function getTickets($index){
		//xmlns:b2b="http://b2b.easyjet.com/"
		$client = new  SoapClient('https://b2bs109.easyjet.com/Service.asmx?WSDL',array('login'   => "$this->credUser",
                                                                                                'password'   => "$this->credPass",
                                                                                                'uri' => 'http://b2b.easyjet.com/'));
																									 
		$body = '
			 <!--Optional:-->
			 <b2b:oInputXml>
                            <testconnection/>
			 </b2b:oInputXml>
		      ';
		//$body =  json_decode(json_encode((array) @simplexml_load_string($body)),1);
		
		$header = new SoapHeader("b2b", "http://b2b.easyjet.com/"); 
		$client->__setSoapHeaders($header);
	//	$client->setCredentials($this->cred_user,$this->cred_pass);
	try{    
	//	$result  = $client->__doRequest($body,"https://b2bs109.easyjet.com/Service.asmx?WSDL", 'RequestXml',1);
		$result = $client->__soapCall('RequestXml', $body);
	}catch(Exception $e){
		print_r($e);
	}
	
		print_r($result);
	//	echo "REQUEST:\n" . $client->__getLastRequestHeaders()  . "<br/>";
	//	echo "REQUEST:\n" . $client->__getLastRequest() . "\n";
	}
}





